package com.my.chapter9;

public class practice10 {
    public static void main(String[] args) {
        Music6.main(args);
    }
}

interface Instrument1{
    int VALUE = 5;
    void adjust();
}

interface Playable{
    void play();
}

class Wind1 implements Instrument1,Playable{

    @Override
    public void play() {
        System.out.println(this + ".play()" +VALUE);
    }

    @Override
    public String toString() {
        return "Wind";
    }

    @Override
    public void adjust() {
        System.out.println(this +".adjust()");
    }
}

class Percussion1 implements Instrument1,Playable{

    @Override
    public void play() {
        System.out.println(this + ".play()" +VALUE);
    }

    @Override
    public String toString() {
        return "Percussion";
    }

    @Override
    public void adjust() {
        System.out.println(this +".adjust()");
    }
}

class Stringed1 implements Instrument1,Playable{

    @Override
    public void play() {
        System.out.println(this + ".play()" +VALUE);
    }

    @Override
    public String toString() {
        return "Stringed";
    }

    @Override
    public void adjust() {
        System.out.println(this +".adjust()");
    }
}

class Brass1 extends Wind1{
    @Override
    public String toString() {
        return "Brass";
    }
}

class Woodwind1 extends Wind1{
    @Override
    public String toString() {
        return "Woodwind";
    }
}

class Music6{
    static void tune(Playable i){
        i.play();
    }
    static void tuneAll(Playable[] e){
        for(Playable i:e){
            tune(i);
        }
    }

    public static void main(String[] args) {
        Playable[] orchestra = {
                new Wind1(),
                new Percussion1(),
                new Stringed1(),
                new Brass1(),
                new Woodwind1()
        };
        tuneAll(orchestra);
    }
}




